#define _CRT_SECURE_NO_WARNINGS 1

void Reverse(int* nums, int a, int end)
{
    int i = 0;
    while (i + a < end - 1 - i)
    {
        int tmp = nums[i + a];
        nums[i + a] = nums[end - 1 - i];
        nums[end - 1 - i] = tmp;
        i++;
    }
}




int main()
{
    int nums[7] = { 1,2,3,4,5,6,7 };
    int num = 7;
    int k = 3;
    Reverse(nums, 0, num - k );
    Reverse(nums, num - k, num);
    Reverse(nums, 0, num);

    return 0;
}



















